<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<html>
<head>
    <title>添加新闻</title>
    <base href="<%=basePath %>">
    <link rel="stylesheet" href="../layui/css/layui.css">
</head>

<body class="layui-layout-body" style="background-color:#2F4056">
<div class="layui-layout layui-layout-admin">
    <jsp:include page="top.jsp" flush="true"></jsp:include>
    <jsp:include page="left.jsp" flush="true"></jsp:include>
    <div class="layui-body">
        <div style="padding: 15px;position: absolute;left: 30%;top: 20px">
            <div class="layui-card" style="width: 400px;height: 300px;">
                <div class="layui-card-header" style="background-color: #FF5722">添加新闻类别</div>
                <div style="margin: 5px">
                    <form method="post" action="/AddCate" class="layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">类别名</label>
                            <div class="layui-input-inline">
                                <input type="text" name="catename" required lay-verify="required" placeholder="请输入类别名!"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">添加者</label>
                            <div class="layui-input-inline">
                                <input type="text" name="addername" required lay-verify="required"
                                       autocomplete="off" class="layui-input" value="">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" type="submit">添加</button>
                                <button class="layui-btn" type="reset">重置</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <jsp:include page="footer.jsp" flush="true"></jsp:include>
</div>
<script src="/layui/layui.js"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function () {
        var element = layui.element;
    });
</script>
<%--类别选择--%>
<script>
    //Demo
    layui.use('form', function () {
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function (data) {
            layer.msg(JSON.stringify(data.field));
            return false;
        });
    });
</script>
</body>
</html>

